<div nz-row>
    <div nz-col nzSpan="12" style="padding:0 0 10px 0">
        <ng-content #selfDef></ng-content>
        <button *ngIf="btnShowCheck('add')" nz-button nzType="primary" (click)="addModal()">
            <i nz-icon nzType="plus"></i>新增</button>
        <button *ngIf="btnShowCheck('tibao')" nz-button nzType="primary" (click)="optAll('tibao')" nzGhost>
            <i nz-icon nzType="check"></i>提报</button>
        <button *ngIf="btnShowCheck('delete')" nz-button nzType="primary" (click)="optAll('delete')" nzGhost>
            <i nz-icon nzType="delete"></i>删除</button>

        <button *ngIf="btnShowCheck('pizhun')" nz-button nzType="primary" (click)="optAll('pizhun',advice)" nzGhost>
            <i nz-icon nzType="check"></i>批准</button>
        <button *ngIf="btnShowCheck('bohui')" nz-button nzType="primary" (click)="optAll('bohui',advice)" nzGhost>
            <i nz-icon nzType="close"></i>驳回</button>
        <button *ngIf="btnShowCheck('qzbohui')" nz-button nzType="primary" (click)="optAll('qzbohui',advice)" nzGhost>
            <i nz-icon nzType="close"></i>强制驳回</button>
        <ng-template #advice>
            <textarea nz-input [(ngModel)]="wsNote" [nzAutosize]="{minRows:5}" placeholder="填写审批意见"></textarea>
        </ng-template>
    </div>
    <div nz-col nzSpan="12" style="display:flex;justify-content:flex-end;padding-bottom:5px;">
        <span style="margin-top:5px">年月：</span>
        <nz-month-picker [(ngModel)]="queryData.ym" nzPlaceHolder="请选择年月"></nz-month-picker>&nbsp;&nbsp;&nbsp;
        <span style="margin-top:5px">审批状态：</span>
        <nz-select [(ngModel)]="queryData.vcStatus" style="width: 150px;margin-left:10px" nzPlaceHolder="请选择审批状态"
            nzAllowClear="true">
            <nz-option *ngFor="let item of spztList" [nzLabel]="item.opName" [nzValue]="item.opValue"></nz-option>
        </nz-select>&nbsp;&nbsp;&nbsp;
        <span style="margin-top:5px">车间：</span>
        <nz-select [(ngModel)]="queryData.cjorg" style="width: 150px;margin-left:10px" nzPlaceHolder="请选择车间"
            nzAllowClear="true">
            <nz-option *ngFor="let item of cjList" [nzLabel]="item.opName" [nzValue]="item.opValue"></nz-option>
        </nz-select>

        <!-- <nz-select *ngIf="queryCmpShowCheck('cjSelect')" [(ngModel)]="queryData.cjorg"
            style="width: 150px;margin-left:10px" nzPlaceHolder="选择车间" nzAllowClear="true">
            <nz-option *ngFor="let item of cjList" [nzLabel]="item.opName" [nzValue]="item.opValue">
            </nz-option>
        </nz-select> -->

        <nz-select *ngIf="queryCmpShowCheck('gqSelect')" [(ngModel)]="queryData.gqorg" style="width: 150px;"
            nzPlaceHolder="选择工区" nzAllowClear="true">
            <nz-option *ngFor="let item of gqList" [nzLabel]="item.opName" [nzValue]="item.opValue">
            </nz-option>
        </nz-select>

        <button style="margin-left:10px" nz-button nzType="primary" (click)="readyload(1,pageSize)"><i nz-icon
                nzType="search"></i>查询</button>
    </div>
</div>

<div>
    <nz-table #rowSelectionTable nzSize="small" [nzScroll]="lockHeadScroll" [nzLoadingDelay]="1000"
        [nzShowPagination]="false" [nzFrontPagination]="false" [nzData]="tableData" nzBordered>
        <thead>
            <tr>
                <th nzWidth="50px" nzAlign="center" nzShowCheckbox (nzCheckedChange)="checkAll($event)"></th>
                <th nzWidth="50px" nzAlign="center">序号</th>
                <th nzWidth="8%" nzAlign="center">部门</th>
                <th nzWidth="8%" nzAlign="center">月表</th>
                <th nzWidth="8%" nzAlign="center">状态</th>
                <ng-container
                    *ngIf="['gcs', 'jskz', 'dz','qzbh'].includes(user.userType) && user.tab === 1;else normalTH">
                    <th nzWidth="8%" nzAlign="center">技术科审批人</th>
                    <th nzWidth="8%" nzAlign="center">技术科审批时间</th>
                    <th nzWidth="12%" nzAlign="center">技术科审批意见</th>
                    <th nzWidth="8%" nzAlign="center">领导审批人</th>
                    <th nzWidth="8%" nzAlign="center">领导审批时间</th>
                    <th nzWidth="12%" nzAlign="center">领导审批意见</th>
                </ng-container>
                <ng-template #normalTH>
                    <th nzWidth="15%" nzAlign="center">审批人</th>
                    <th nzWidth="15%" nzAlign="center">审批时间</th>
                    <th nzAlign="center">审批意见</th>
                </ng-template>
                <th nzWidth="8%" nzAlign="center">录入人</th>
                <th nzWidth="8%" nzAlign="center">录入时间</th>
            </tr>
        </thead>
        <tbody>
            <ng-container *ngIf="['gcs', 'jskz', 'dz','qzbh'].includes(user.userType) && user.tab === 1;else normalTd">
                <tr *ngFor="let data of rowSelectionTable.data;let i = index" (dblclick)="trDbclick(data)" nz-tooltip
                    nzTooltipTitle="双击查看详情" nzTooltipPlacement="bottom" style="cursor:pointer">
                    <td nzShowCheckbox [(nzChecked)]="data.checked"></td>
                    <td nzAlign="center">{{+i+1}}</td>
                    <td nzAlign="center">{{data.ORGNAME}}</td>
                    <td>{{data.PLANNAME}}</td>
                    <td nzAlign="center">
                        <!-- {{statusList[data.VC_STATUS]}} -->
                        <span class="flowInfo"
                            (click)="statusShowModal(data.N_ID)">{{statusList[data.VC_STATUS]}}</span>
                        <!-- <span class="flowInfo" (click)="statusShowModal(data.N_ID)">{{data.STATUS}}</span> -->
                    </td>
                    <td nzAlign="center">{{data.VC_WS$APP$PER}}</td>
                    <td nzAlign="center">{{data.VC_WSAPPDATE}}</td>
                    <td>{{data.VC_WS$APP$NOTE}}</td>
                    <td nzAlign="center">{{data.VC_SEG$APP$PER}}</td>
                    <td nzAlign="center">{{data.VC_SEGAPPDATE}}</td>
                    <td>{{data.VC_SEG$APP$NOTE}}</td>
                    <td nzAlign="center">{{data.VC_USER$ID}}</td>
                    <td nzAlign="center">{{data.DTSYSDATE}}</td>
                </tr>
            </ng-container>
            <ng-template #normalTd>
                <tr *ngFor="let data of rowSelectionTable.data;let i = index" (dblclick)="trDbclick(data)" nz-tooltip
                    nzTooltipTitle="双击查看详情" nzTooltipPlacement="bottom" style="cursor:pointer">
                    <td nzShowCheckbox [(nzChecked)]="data.checked"></td>
                    <td nzAlign="center">{{+i+1}}</td>
                    <td nzAlign="center">{{data.ORGNAME}}</td>
                    <td>{{data.PLANNAME}}</td>
                    <td nzAlign="center">
                        <span class="flowInfo" (click)="statusShowModal(data.N_ID)">{{data.STATUS}}</span>
                    </td>
                    <td nzAlign="center">{{data.VC_WS$APP$PER}}</td>
                    <td nzAlign="center">{{data.VC_WSAPPDATE}}</td>
                    <td>{{data.VC_WS$APP$NOTE}}</td>
                    <td nzAlign="center">{{data.VC_USER$ID}}</td>
                    <td nzAlign="center">{{data.DTSYSDATE}}</td>
                </tr>
            </ng-template>
        </tbody>
    </nz-table>
</div>
<div style="display: flex;justify-content: space-between;">
    <div style="padding:5px 10px">
        每页
        <nz-select [(ngModel)]="pageSize" (ngModelChange)="pageSizeChange($event)">
            <nz-option nzValue="10" nzLabel="10"></nz-option>
            <nz-option nzValue="50" nzLabel="50"></nz-option>
            <nz-option nzValue="100" nzLabel="100"></nz-option>
            <nz-option nzValue="200" nzLabel="200"></nz-option>
        </nz-select> 条&nbsp;&nbsp;&nbsp;总共<span class="pageTotal">{{pageTotal}}</span>条
    </div>
    <div style="padding:5px 10px">
        <nz-pagination [nzPageSize]="pageSize" [nzPageIndex]="pageIndex" [nzTotal]="pageTotal"
            (nzPageIndexChange)="pageIndexChange($event)"></nz-pagination>
    </div>
</div>


<nz-modal [(nzVisible)]="yearVisible" nzTitle="新增月计划" (nzOnCancel)="addCancel()" (nzOnOk)="addOk()"
    [nzOkLoading]="yearLoading">
    <nz-month-picker [(ngModel)]="addData.ym" nzPlaceHolder="选择年月">
    </nz-month-picker>
</nz-modal>

<app-ststusyear *ngIf="statusYearVisible" [statusType]="'month'" [statusNid]="statusYearNid"
    (statusCloseModal)="statusHideModal()">
</app-ststusyear>